<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //replase(新字符，老字符)实现字符串的替换  只能替换一个，用循环替换多个
        //经常伴随正则使用
        let str = "shidazhishidazhi"
        console.log(str.replace('s', '$'));
    </script>
</body>

</html>